package cn.e4j.modular.system.service.impl;

import cn.e4j.core.dto.impl.Dto;
import cn.e4j.modular.system.entity.SysParams;
import cn.e4j.modular.system.mapper.SysParamsMapper;
import cn.e4j.modular.system.service.SysParamsService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 参数表 服务实现类
 * </p>
 *
 * @author wenchuan.li
 * @since 2018-12-13
 */
@Service
public class SysParamsServiceImpl extends ServiceImpl<SysParamsMapper, SysParams> implements SysParamsService {

    @Transactional(readOnly = true)
    public List<Map<String, Object>> getParamslist(Page<Object> page, Dto dto) {

        List<Map<String, Object>> paramsDtos = this.baseMapper.listParamsPage(page, dto);

        return paramsDtos;
    }

    @Override
    public SysParams getByKey(String code) {
        return this.baseMapper.getByKey(code);
    }

}
